// import com.alibaba.druid.sql.ast.SQLExpr;
// import com.alibaba.druid.sql.ast.SQLName;
// import com.alibaba.druid.sql.dialect.sqlserver.ast.SQLServerObjectImpl;
// import com.alibaba.druid.sql.dialect.sqlserver.ast.SQLServerStatement;
// import com.alibaba.druid.sql.dialect.sqlserver.ast.SQLServerStatementImpl;
// import com.alibaba.druid.sql.dialect.sqlserver.visitor.SQLServerASTVisitor;

// import java.util.ArrayList;
// import java.util.List;

#include "SQLServerExecStatement.h"
#include "../../../../ast/SQLExpr.h"
#include "../../../../ast/SQLName.h"
#include "../../visitor/SQLServerASTVisitor.h"
#include "../../../../../utils/listTran.h"

SQLExpr_ptr SQLServerExecStatement_SQLServerParameter::getExpr()
{
  return expr;
}

void SQLServerExecStatement_SQLServerParameter::setExpr(SQLExpr_ptr expr)
{
  this->expr = expr;
}

BOOL_ptr SQLServerExecStatement_SQLServerParameter::getType()
{
  return type;
}

void SQLServerExecStatement_SQLServerParameter::setType(BOOL_ptr type)
{
  this->type = type;
}

// @Override
void SQLServerExecStatement_SQLServerParameter::accept0(SQLServerASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLServerExecStatement_SQLServerParameter)))
  {
    acceptChild(visitor, expr);
  }
  visitor->endVisit(SharedObject(SQLServerExecStatement_SQLServerParameter));
}

SQLServerExecStatement::SQLServerExecStatement()
{
  parameters = std::make_shared<std::list<SQLServerExecStatement_SQLServerParameter_ptr>>();
}
SQLName_ptr SQLServerExecStatement::getModuleName()
{
  return moduleName;
}

void SQLServerExecStatement::setModuleName(SQLName_ptr moduleName)
{
  this->moduleName = moduleName;
}

SQLServerExecStatement_SQLServerParameter_list_ptr SQLServerExecStatement::getParameters()
{
  return parameters;
}

void SQLServerExecStatement::accept0(SQLServerASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLServerExecStatement)))
  {
    acceptChild(visitor, this->returnStatus);
    acceptChild(visitor, this->moduleName);
    SQLObject_list_ptr tmp = ListTran::tran_class<SQLServerExecStatement_SQLServerParameter, SQLObject>(this->parameters);
    acceptChild(visitor, tmp);
  }
  visitor->endVisit(SharedObject(SQLServerExecStatement));
}

SQLName_ptr SQLServerExecStatement::getReturnStatus()
{
  return returnStatus;
}

void SQLServerExecStatement::setReturnStatus(SQLName_ptr returnStatus)
{
  this->returnStatus = returnStatus;
}
